<?php
$className = "Remote";
@include_once "installableInterface.inc";
/*
 * All operations concerning a single user
 * are to be handled by the User class.
 */
class Remote implements Installable {
    private $db = null;
    /**
     * The minimal constructor expects at least a Database object.
     *
     * @param Database $db
     */
    public function __construct($db) {
        $this->db = $db;
    }

    /**
     * If the table exists it can be dropped in case
     * a reinstallation is neccessary for instance.
     * @param <link identifier> $db is the database handle.
     */
    public function dropTable() {
        $sql = "DROP TABLE IF EXISTS `Remote`";
        $rs = $this->db->executeSQL($sql);
    }

    /**
     * Initially creates the table Users when the database is installed.
     * @param <link identifier> $db is the database handle.
     */
    public function createTable() {
        $this->dropTable();
        $sql = "
            CREATE TABLE  `Remote` (
              `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
              `userID` int(10) unsigned NOT NULL,
              `caption` varchar(45) NOT NULL,
              `server` varchar(255) NOT NULL,
              `email` varchar(255) NOT NULL,
              `password` varchar(100) NOT NULL,
              PRIMARY KEY (`ID`),
              KEY `userK` (`userID`)
            ) ENGINE=InnoDB DEFAULT CHARSET=latin1
        ";
        $rs = $this->db->executeSQL($sql);
        if(!$rs)
            return(false);
        return(true);
    }
    public function insertInitialData() {
    }
}
?>
